package com.ay272.ssh2.kaoqing.action;

import com.ay272.ssh2.kaoqing.biz.QianBiz;
import com.ay272.ssh2.kaoqing.entity.Qian;
import com.opensymphony.xwork2.ActionSupport;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 * Created by java on 2016/5/17.
 */
@Controller("kaoqing.qianAction")
@Scope("prototype")
public class QianAction extends ActionSupport {
    @Qualifier("qianBizImpl")
    @Autowired
    private QianBiz biz;
    private Qian qian;
    private Object data;

    public QianBiz getBiz() {
        return biz;
    }

    public void setBiz(QianBiz biz) {
        this.biz = biz;
    }



    public Qian getQian() {
        return qian;
    }

    public void setQian(Qian qian) {
        this.qian = qian;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public  String  save(){
        try {
            qian = new Qian();
            qian.setIp("192.168.11.12");
            qian.setTime("2016/05/17 19:32:54");
            biz.save(qian);
            this.data = "OK....";
        }catch (Exception e){
            this.data="SORRY....";
            e.printStackTrace();
        }
       return SUCCESS;
   }
}
